package com.asa.ui.B;

import java.awt.Point;

public class Circle {
    public int x;
    public int y;
    private int r;
	public Circle(int x, int y, int r) {
		super();
		this.x = x;
		this.y = y;
		this.r = r;
	}

    public int getR() {
		return r;
	}

	public void setR(int r) {
		this.r = r;
	}

	//求点是否在圆内
	public boolean contains(Point p){
		return Math.pow(p.x-x, 2)+Math.pow(p.y-y,2)<=Math.pow(r, 2);
	}
}

